package com.etc.delivery.dao.driver;


import com.etc.delivery.dto.DriverDto;
import com.etc.delivery.entity.Driver;
import com.etc.delivery.entity.Warehouse;
import com.etc.delivery.entity.Waybill;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import javax.servlet.http.HttpSession;
import java.util.List;

@Repository
public interface IDriverDao1 {

    /**
     * 检查手机号是否存在
     *
     * @param phone
     * @return
     */
    public List<Driver> checkPhone(String phone);


    /**
     * 注册
     *
     * @param driver
     * @return
     */
    public boolean register(Driver driver);


    /**
     * 登录
     *
     * @param phone
     * @param password
     * @return
     */
    public List<Driver> DriverLogin(@Param("phone") String phone, @Param("password") String password);


    /**
     * 查询所有订单
     *
     * @return
     */
    public List<Waybill> queryAllWaybill(Integer warehouseId);

    public List<Waybill> queryAllWaybill1(Integer warehouseId);

    /**
     * 修改密码
     *
     * @return
     */
    public boolean modifyPassword(Driver driver);


    /**
     * 通过号码查询司机
     *
     * @return
     */
    public Driver queryDriverByPhone(@Param("phone") String phone);


    /**
     * 修改司机资料
     *
     * @param driver
     * @return
     */
    public boolean modifyDriver(Driver driver);


    /**
     * 修改订单状态
     *
     * @param waybillNo
     * @return
     */
    public boolean modifyWaybillStatus(@Param("waybillNo") String waybillNo, @Param("driverId") Integer driverId, @Param("warehouseId") Integer warehouseId);

    public boolean modifyWaybillStatus1(@Param("waybillNo") String waybillNo, @Param("driverId") Integer driverId);

    public boolean arrived(String waybillNo);

    /**
     * 根据运单状态查询 status=3
     *
     * @return
     */
    public List<Waybill> queryWaybillByStatus();

    /**
     * 根据运单状态查询 status=1
     *
     * @return
     */
    public List<Waybill> queryWaybillByStatus1();


    /**
     * 查询司机接受的运单
     *
     * @return
     */
    public List<Waybill> queryWaybillByDriverId(Integer id);


    /**
     * 确认运单送达
     *
     * @param status
     * @return
     */
    public boolean changeDriverWaybillStatus(String status);

    public List<DriverDto> queryMyInfo(Integer id);

    public List<Warehouse> queryWareName();

    public String getPassword(String phone);

    public List<Driver> checkEmail(@Param("email") String email, @Param("phone") String phone);


}
